/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (c) 2013-2014 sagyf Yang. The Four Group.
 */

package app;

import com.github.sog.config.StringPool;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.jfinal.kit.PathKit;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * .
 * </p>
 *
 * @author sagyf yang
 * @version 1.0 2014-04-09 16:34
 * @since JDK 1.6
 */
public class Const {

    public static final int    GIFT_STYLE_GIFT     = 1;
    public static final int    GIFT_STYLE_CURRENCY = 2;
    public static final int    GIFT_STYLE_INTEGRAL = 3;
    /*cache name define*/
    public static final String CACHE_MALL_BLOCK    = "mall.block.cache";

    // public static final String MOBILEWXMEMBER_ATTR = "MobileWxMember";
    public static final String CACHE_AUTH_RESOURCE   = "auth.resource.cache";
    public static final String CACHE_MEMBER_RANK     = "member.rank.cache";
    public static final String CACHE_IMPORT_MASK     = "member.import.cache";
    public static final String CACHE_SYSTEM_CATEGORY = "system.smscategory.cache";
    public static final String CACHE_SYSTEM_SETTING  = "system.setting.cache";
    public static final String CACHE_SMSCODE_MEMBER  = "member.smscode.cache";


    public static final String COOKIE_IMPORT_FILE = "import-member-filename";

    public final static int IMPORT_MAX_AGE         = 86400;
    public static final int MEMBER_PHONE_CODE_TIME = 30;


    public static final String ACTION_ATTR       = "action";
    public static final String CREATE_ACTION     = "create";
    public static final String EDIT_ACTION       = "edit";
    public static final String DATA_PARAM        = "DATA";
    public static final String MESSAGE_ATTR      = "message";
    public static final String MEMBER_PARAM      = "mid";
    public static final String WX_PARAM          = "wxno";
    public static final String MEMBER_ATTR       = "member";
    public static final String COLUMN_STATUS     = "status";
    /**
     * 餐饮品牌
     */
    public static final String REPAST            = "repast";
    /**
     * KTV品牌
     */
    public static final String KTV               = "ktv";


    /**
     * 积分、中南币操作原因
     */
    public static final String TICKET_EXC_REASON = "小票兑换";
    public static final String DINING_ADD        = "餐饮预订奖励";
    public static final String DINING_CUT        = "餐饮预订使用";
    public static final String EXCHANGE_TO_INTEGRAL = "兑换积分";
    public static final String EXCHANGE_FROM_CURRENCY = "中南币兑换";


    public static final Map<String, String>  MOVIE_TYPES_MAP  = new HashMap<String, String>() {
        {
            put(MOVIE_TYPES.MOVIE_TYPE_LOVE, "爱情");
            put(MOVIE_TYPES.MOVIE_TYPE_KUNGFU, "功夫");
        }

        private static final long serialVersionUID = 2302541185467327562L;
    };
    public static final Map<Integer, String> MOVIE_STATUS_MAP = new HashMap<Integer, String>() {
        {
            put(MOVIE_STATUS.STATUS_0, "过期");
            put(MOVIE_STATUS.STATUS_1, "正在热映");
            put(MOVIE_STATUS.STATUS_2, "即将上映");
        }

        private static final long serialVersionUID = -1634042551532550585L;
    };
    // database column name

    public static final Splitter CRLF_SPLITTER   = Splitter.on(StringPool.CRLF).trimResults().omitEmptyStrings();
    public static final Splitter BRACES_SPLITTER = Splitter.on("{}").trimResults().omitEmptyStrings();
    public static final Joiner   BRACES_JOINER   = Joiner.on("{}").skipNulls();
    public static final Splitter COMMA_SPLITTER  = Splitter.on(", ").trimResults().omitEmptyStrings();

    public static class Report {
        public static final String REPORT_DIR_PATH         = PathKit.getWebRootPath() + File.separator + "reports" + File.separator;
        public static final String BRAND_DAIYL_REPORT_PATH = REPORT_DIR_PATH + "brand_daily_stat.xlsx";

        public static final String RECORD_ATTR = "record";
    }

    public static final class MOVIE_TYPES {
        public static final String MOVIE_TYPE_LOVE   = "love"; //爱情
        public static final String MOVIE_TYPE_KUNGFU = "kungfu"; //功夫
    }


    public static final class MOVIE_STATUS {
        /**
         * 过期
         */
        public static final int STATUS_0 = 0;
        /**
         * 正在热映
         */
        public static final int STATUS_1 = 1;
        /**
         * 即将上映
         */
        public static final int STATUS_2 = 2;
    }

    public static final class BOOKING_STATUS {
        /**
         * 过期
         */
        public static final int STATUS_0 = 0;
        /**
         * 预定成功 未到店
         */
        public static final int STATUS_1 = 1;
        /**
         * 已使用 已到店
         */
        public static final int STATUS_2 = 2;

    }


}
